<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>签约网</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/lawyer.css" />
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/lawyer.js"></script>
</head>
<body>
<div id="secHeader">
  <header class="header">
      <a href="javascript:void(0);" onclick="api.closeWin()" class="back_btn"><img src="../image/head-fanhui.png" alt=""></a>
      <h2>委托详情</h2>
      <!--<a href="javascript:void (0);" class="search_btn set_btn">设置</a>-->
  </header>
</div>
<section class="crowd_details_img">
    <img src="../image/crowd_details_img.png" id="icon">
    <div class="details_progress">
        <div class="details" style="margin-top: 0!important;">
            <ul>
                <li>
                    <span><b>892.45</b>元 </span>
                    <p>目标金额</p>
                </li>
            </ul>
        </div>
    </div>
    <div class="crowd_title">
        <h6>儿子工作致盲，被单位抛弃</h6>
        <p>因操作不慎使一只眼睛完全看不清东西，却被单位狠心抛弃</p>
    </div>
</section>
<section class="crowd_details">
    <div class="common_title">
        <h6 style="font-weight: normal; font-size: 0.3rem;">众筹详情</h6>
    </div>
    <div class="content">
        <p>
            病痛突来，前路未知。<br>
            蕲水县农民喜大叔，今年69岁，儿子出事前，夫妻俩除了务农，还经常外出打工，准备年底过个好年。谁知这一场突如其来的意外，彻底改变了这个家庭的命运。<br>
            儿子在工作中因操作不慎使一只眼睛成为了盲眼，这个家庭不仅花光了所有存款还负债累累，沉重的治疗费用已经压垮了这个家庭。<br>
            儿子出事后，大叔老两口一夜之间变得特别沧桑，大娘也以为着急住了几天院，只有大叔一人还在撑着。<br>
            如今儿子单位在儿子出事后不管不问，一分治疗钱都没有出，大叔已经没有办法，只好在这里请求帮助，让好心人出一份力，帮助他们讨个说法。<br>
        </p>
        <ul>
            <li><img src="../image/applyh_pic1.png" alt=""></li>
            <li><img src="../image/applyh_pic2.png" alt=""></li>
            <li><img src="../image/applyh_pic3.png" alt=""></li>
        </ul>
    </div>
</section>
<section class="comment_section">

    <div class="news_title">
        <h2>信托律师</h2>
    </div>
    <div class="comment_list">
        <ul>
            <li>
                <div class="userInfo">
                    <img src="../image/userimg1.jpg" alt="">
                    <div class="userName">
                        <h6>张岳伦律师 <i>LV.6</i></h6>
                        <span>2019-11-11  14:45</span>
                    </div>
                </div>
                <div class="service_kinds">
                    <dl>
                        <dd>遗产纠纷</dd>
                        <dd>劳动仲裁</dd>
                        <dd>人身损害</dd>
                        <dd>合同纠纷</dd>
                        <dd>家产分割</dd>
                    </dl>
                </div>
            </li>

        </ul>
    </div>
</section>
<section class="fixed_ask">
    <a href="javascript:;" onclick="aaplay('index','##')" class="ask_btn bid_btn">我要投标</a>
</section>


</body>

<script>
    var para
    var lastime=0
    var zcid
    apiready = function () {
        $api.fixStatusBar( $api.dom('#secHeader') );
      api.setStatusBarStyle({
          style: 'light'
      });


        para=api.pageParam



        var p={id:para.id}
        api.ajax({
                url: webSiteUrl+'/app/public/wtdetail',
                method: 'post',
                data: {
                    values: p
                }
            }, function(ret, err) {


                if(ret.code==200){


                    var tj=ret.data.uinfo;
                    $('#icon').attr('src',webSiteUrl+tj.icon);
                    $('#phone').html(tj.phone);


                    var info=ret.data.info;

                    $('#time').html(info.time);
                    $('#content').html(info.content);
                    $('#price').html(info.price+'元');
                    $('#margin').html(info.margin+'元');
                    $('#lasttime').html('投标截止时间：'+info.lasttime);
                    lastime=info.last_time

                    zcid=info.tid

                    if(info.over==1){
                       $('.fixed_ask').hide()
                    }

                    html = "";
                    var tj=ret.data.list;
                    if(tj != null){

for(var i=0;i<tj.length;i++){
html+='<li><div class="userInfo"><img src="'+webSiteUrl+tj[i].icon+'" alt=""><div class="userName"><h6>'+tj[i].nickname+'律师 <i>LV.6</i></h6><span>'+tj[i].time+'</span></div></div><div class="service_kinds"><dl>';

    if(tj[i].label.length>0){
        for(var j=0;j<tj[i].label.length;j++){
            html+='<dd>'+tj[i].label[j]+'</dd>';
        }
    }
html+='</dl></div></li>';
}
                        $('#con').html(html);
                    }else{
                        $('#con').html('<p style="text-align:center">暂无信托</p>');
                    }



                }
            });

    };


    function aaa(){
        var p={'model':zc,id:zcid}
        api.ajax({
                url: webSiteUrl+'/app/home/find',
                method: 'post',
                data: {
                    values: p
                }
            }, function(ret, err) {
                var tj=ret.data
                $('#icon').attr('src',webSiteUrl+tj.icon)
            })

    }

    function jionwt(){
        var timestamp = (new Date()).getTime();
        if(timestamp>lasttime){
            alert('投标已截止，请查看其他案源');return;
        }
        var money=$('#money').val();
        if(!/^[0-9]+$/.test(money)){
            alert('金额必须是数字');return;
        }
        var p={token:token,id:para.id,money:money};
        api.ajax({
                url: webSiteUrl+'/app/user/joinwt',
                method: 'post',
                data: {
                    values: p
                }
            }, function(ret, err) {
                api.hideProgress();

                if(ret.code==200){

                    html = "";
                    var tj=ret.data;
                    if(tj != null){


html+='<li><div class="userInfo"><img src="'+webSiteUrl+tj.icon+'" alt=""><div class="userName"><h6>'+tj.nickname+'律师 <i>LV.6</i></h6><span>'+tj.time+'</span></div></div><div class="service_kinds"><dl>';

    if(tj.label.length>0){
        for(var j=0;j<tj.label.length;j++){
            html+='<dd>'+tj.label[j]+'</dd>';
        }
    }
html+='</dl></div></li>';
                    }
                    if($('#con li').length>0){
                        $('#con').prepend(html);
                    }else{
                        $('#con').html(html);
                    }


                    alert(ret.msg)
                }else{

                    alert(ret.msg)


                }
            });

    }

    function askdetail(id){
        api.openWin({
            name: 'askdetail',
            url: 'askdetail.html',
            reload:true,
            pageParam: {
                id: id,

            }
        });
    }

    //投标
    $(".bid_btn").click(function () {
        $(".fixed_bid").fadeToggle();
        $(".fixed_bid .bid_section").animate({
            'top': '0',
            'opacity': '1'
        },400);
    });
    $(".bid_section .sure_btn").click(function () {
        $(".fixed_bid").fadeToggle();
        $(".fixed_bid .bid_section").animate({
            'top': '-4rem',
            'opacity': '0'
        },400);
    });
    //撤标
    $(".withdraw_btn").click(function () {
        $(".my_bidInfo").html('无')
    });

</script>
</html>
